package day4zy;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Scanner;

public class Fuqinjie {
    public static void main(String[] args) {
        int s = 0;
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        System.out.println("请输入年份：");
        Scanner in = new Scanner(System.in);
        int nf = in.nextInt();
        Calendar dyt = Calendar.getInstance();
        dyt.set(nf,0,1);
        for (int i = 1; i <= 365; i++) {
            dyt.set(nf,0,i);
            if (dyt.get(Calendar.MONTH)== 5){
                //System.out.println(dyt.getTime());
                if (dyt.get(Calendar.DAY_OF_WEEK)==7){
//                    System.out.println(dyt.getTime());
                    s++;
                    if (s==3){
                        System.out.println(df.format(dyt.getTime()));
                        System.out.println(dyt.get(Calendar.DAY_OF_YEAR));
                    }
                }
            }
        }
    }
}
